import ajax from '@/utils/ajax'

export const upload = (file, host, OSSAccessKeyId, policy, Signature, key) => {
    const param = new FormData();
    param.append("key", key);
    param.append("OSSAccessKeyId", OSSAccessKeyId);
    param.append("policy", policy);
    param.append("Signature", Signature);
    param.append("success_action_status", "200");
    param.append("file", file);

    return ajax.uploadPost(host, param)
};

export const getAliSign = function (fileType) {
    return ajax.post('/sys/ailiUpload/getAliSign', {fileType: fileType}, true)
}
export const getImgPath = function (path) {
    return ajax.post('/sys/ailiUpload/getImgPath', {path: path}, true)
}
export const getFilePath = function (path) {
    return ajax.post('/sys/ailiUpload/getFilePath', {path: path}, true)
}
export const getImgPathList = function (path) {
    return ajax.post('/sys/ailiUpload/getImgPathList', path)
}


